import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { MeetingRoomInfoVO, mettingRoomInfoForm, mettingRoomInfoQuery } from '@/api/efficient-office/meeting-room-info/types';

/**
 * 查询会议室-信息列表
 * @param query
 * @returns {*}
 */

export const listMeetingRoomInfo = (query?: mettingRoomInfoQuery): AxiosPromise<MeetingRoomInfoVO[]> => {
  return request({
    url: '/meeting-room/meeting-room-info/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询会议室-信息详细
 * @param meetingRoomId
 */
export const getMeetingRoomInfo = (meetingRoomId: string | number): AxiosPromise<MeetingRoomInfoVO> => {
  return request({
    url: '/meeting-room/meeting-room-info/' + meetingRoomId,
    method: 'get'
  });
};

/**
 * 新增会议室-信息
 * @param data
 */
export const addMeetingRoomInfo = (data: mettingRoomInfoForm) => {
  return request({
    url: '/meeting-room/meeting-room-info',
    method: 'post',
    data: data
  });
};

/**
 * 修改会议室-信息
 * @param data
 */
export const updateMeetingRoomInfo = (data: mettingRoomInfoForm) => {
  return request({
    url: '/meeting-room/meeting-room-info',
    method: 'put',
    data: data
  });
};

/**
 * 删除会议室-信息
 * @param meetingRoomId
 */
export const delMeetingRoomInfo = (meetingRoomId: string | number | Array<string | number>) => {
  return request({
    url: '/meeting-room/meeting-room-info/' + meetingRoomId,
    method: 'delete'
  });
};

/**
 * 同步会议室-信息
 *
 */
export const syncMeetingRoom = () => {
  return request({
    url: '/meeting-room/meeting-room-info/sync-meeting-room-info',
    method: 'get'
  });
};
